package com.example.demo.infrastructure.persistence;

import com.example.demo.domain.model.User;
import com.example.demo.domain.repository.UserRepository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;

@Repository
public interface JpaUserRepository extends JpaRepository<User, Long>, UserRepository {
    // JpaRepository已经提供了save, findById, deleteById方法的实现
    // 只需添加自定义查询方法
    Optional<User> findByUsername(String username);
    Optional<User> findByEmail(String email);
}